package cn.geminis.lowcode.compiler.code;

import cn.geminis.lowcode.compiler.util.JdkTreeMakerUtils;
import com.sun.source.tree.ExpressionTree;
import com.sun.source.tree.TypeCastTree;
import lombok.RequiredArgsConstructor;

/**
 * @author puddi
 */
@RequiredArgsConstructor
public class LcTypeCast extends AbstractExpression<TypeCastTree> {

    private final String type;
    private final AbstractExpression expression;

    @Override
    protected TypeCastTree createJdkTree() {
        return JdkTreeMakerUtils.typeCast(type, (ExpressionTree) expression.getJdkTree());
    }

}
